home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
Powerbobs.lha
/
powerbobsv1.0
/
examples
/
amal_psprites_60_speed.asc
< prev
next >
Wrap
Text File
|
1995-07-04
|
3KB
|
106 lines
'This demo is for Amiga's with a 68000 processor :
' standard A500 and A500+
' standard A600
' standard A2000
' standard A1000 Phew lucky you !!! It's a candy !
'
Screen Open 0,320,200,2,L
Load "df0:examples/amal_60_sprites.abk"
Hide On
'
'We are only using 60 Psprites, so set the maximum to 60
'This will save some time, specially on 68000 based machines.
'
Psprite Max 60
'We've 16 coloured images in bank 1, so set the Psprite engine in 16 colour
'mode.
'
Set Psprite Colours 16
'
'Convert the Sprite/Bob images in bank 1 from normal format
'to interleaved bitmap format.
'
Convert Sprites 1
'
'Remember, after conversion the bank can be erased !
'This will free a lot of your precious memory.
Erase 1
'
Unpack 10 To 0
'
'It is very important to set the normal Bob and Sprite updates to Off !
'
Update Off
'
'Set Synchro mode to off, because we use 60 ! channels !!!
'I could use all 64 channels, but the screen isn't large enough !!!!
'
Synchro Off
'
'Don't bother about the AMAL setup, just for testing...
'
Y=42
NUM_SPR=0
For I=0 To 14
Randomize Timer
X=128+64
X_ADD=80
For _PSPR=1 To 4
'Use this line for a nice pattern...
A$="Let X="+Str$(X)-" "+"; Let Y="+Str$(Y)-" "+"Let R0="+Str$(-_PSPR)+";Let R1=1;Let R2=1;Let A=Z(5)+1"
'Use this line for total chaos !
' A$="Let X="+Str$(X)-" "+"; Let Y="+Str$(Y)-" "+"Let R0="+Str$(-(Rnd(3)+1))+";Let R1=1;Let R2=1;Let A=Z(5)+1"
'
'I've slowed down the speed with 4 Pause instructions, else the images are
'flipping too fast!
'
A$=A$+"Loop: P ;P ;P ; P;"
A$=A$+"Let X=X+R0 ;"
A$=A$+"If X>432 Jump Reset ;"
A$=A$+"If X<"+Str$(128+NUM_SPR)-" "+" Jump Reset ;"
A$=A$+"Let A=A+R1;"
A$=A$+"If A>7 Jump Image;"
A$=A$+"Jump Loop ;"
A$=A$+"Reset: ;"
A$=A$+"Let R0=R0*-1 ;"
A$=A$+"Jump Loop ;"
A$=A$+"Swapy: ;"
A$=A$+"Let R2=R2*-1 ;"
A$=A$+"Jump Loop ;"
A$=A$+"Image: ;"
A$=A$+"Let A=1 ;"
A$=A$+"Jump Loop ;"
Amal NUM_SPR,A$
Inc NUM_SPR
Add X,X_ADD
Next
Add Y,17
Next
'
'Assign the Psprites to an Amal channel...
'
For I=0 To 59
Pchannel To Psprite I To I
Next
'
'Let's go !
'
Amal On
Multi No
R=Execall(-132)
' Whe use 4 Pause instructions in the Amal progs, so synchronize it to
' the same speed.
Psync Every 4
T=Timer
For I=1 To 1000
' Ok transfer the X/Y and A values to the Psprites and Update them on screen.
'
Synchro
Psync Psprite 0 To 59
Next
Print Timer-T
R=Execall(-138)
Multi Yes
Erase 1
Erase 10